Skip to main content

A framework for machine learning on Apple silicon.

Project description

MLX

Quickstart | Installation | Documentation | Examples

CircleCI

MLX is an array framework for machine learning on Apple silicon, brought to you by Apple machine learning research.

Some key features of MLX include:

  • Familiar APIs: MLX has a Python API that closely follows NumPy. MLX also has fully featured C++, C, and Swift APIs, which closely mirror the Python API. MLX has higher-level packages like mlx.nn and mlx.optimizers with APIs that closely follow PyTorch to simplify building more complex models.

  • Composable function transformations: MLX supports composable function transformations for automatic differentiation, automatic vectorization, and computation graph optimization.

  • Lazy computation: Computations in MLX are lazy. Arrays are only materialized when needed.

  • Dynamic graph construction: Computation graphs in MLX are constructed dynamically. Changing the shapes of function arguments does not trigger slow compilations, and debugging is simple and intuitive.

  • Multi-device: Operations can run on any of the supported devices (currently the CPU and the GPU).

  • Unified memory: A notable difference from MLX and other frameworks is the unified memory model. Arrays in MLX live in shared memory. Operations on MLX arrays can be performed on any of the supported device types without transferring data.

MLX is designed by machine learning researchers for machine learning researchers. The framework is intended to be user-friendly, but still efficient to train and deploy models. The design of the framework itself is also conceptually simple. We intend to make it easy for researchers to extend and improve MLX with the goal of quickly exploring new ideas.

The design of MLX is inspired by frameworks like NumPy, PyTorch, Jax, and ArrayFire.

Examples

The MLX examples repo has a variety of examples, including:

Quickstart

See the quick start guide in the documentation.

Installation

MLX is available on PyPI. To install MLX on macOS, run:

pip install mlx

To install the CUDA backend on Linux, run:

pip install mlx[cuda]

To install a CPU-only Linux package, run:

pip install mlx[cpu]

Checkout the documentation for more information on building the C++ and Python APIs from source.

Contributing

Check out the contribution guidelines for more information on contributing to MLX. See the docs for more information on building from source, and running tests.

We are grateful for all of our contributors. If you contribute to MLX and wish to be acknowledged, please add your name to the list in your pull request.

Citing MLX

The MLX software suite was initially developed with equal contribution by Awni Hannun, Jagrit Digani, Angelos Katharopoulos, and Ronan Collobert. If you find MLX useful in your research and wish to cite it, please use the following BibTex entry:

@software{mlx2023,
  author = {Awni Hannun and Jagrit Digani and Angelos Katharopoulos and Ronan Collobert},
  title = {{MLX}: Efficient and flexible machine learning on Apple silicon},
  url = {https://github.com/ml-explore},
  version = {0.0},
  year = {2023},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mlx-0.29.3-cp313-cp313-manylinux_2_35_x86_64.whl (649.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.35+ x86-64

mlx-0.29.3-cp313-cp313-macosx_15_0_arm64.whl (549.6 kB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

mlx-0.29.3-cp313-cp313-macosx_14_0_arm64.whl (549.6 kB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

mlx-0.29.3-cp313-cp313-macosx_13_0_arm64.whl (549.6 kB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64

mlx-0.29.3-cp312-cp312-manylinux_2_35_x86_64.whl (649.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ x86-64

mlx-0.29.3-cp312-cp312-macosx_15_0_arm64.whl (549.5 kB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

mlx-0.29.3-cp312-cp312-macosx_14_0_arm64.whl (549.5 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

mlx-0.29.3-cp312-cp312-macosx_13_0_arm64.whl (549.5 kB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

mlx-0.29.3-cp311-cp311-manylinux_2_35_x86_64.whl (652.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.35+ x86-64

mlx-0.29.3-cp311-cp311-macosx_15_0_arm64.whl (549.1 kB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

mlx-0.29.3-cp311-cp311-macosx_14_0_arm64.whl (549.1 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

mlx-0.29.3-cp311-cp311-macosx_13_0_arm64.whl (549.1 kB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

mlx-0.29.3-cp310-cp310-manylinux_2_35_x86_64.whl (652.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.35+ x86-64

mlx-0.29.3-cp310-cp310-macosx_15_0_arm64.whl (548.9 kB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

mlx-0.29.3-cp310-cp310-macosx_14_0_arm64.whl (548.9 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

mlx-0.29.3-cp310-cp310-macosx_13_0_arm64.whl (548.9 kB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

mlx-0.29.3-cp39-cp39-manylinux_2_35_x86_64.whl (653.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.35+ x86-64

mlx-0.29.3-cp39-cp39-macosx_15_0_arm64.whl (549.3 kB view details)

Uploaded CPython 3.9macOS 15.0+ ARM64

mlx-0.29.3-cp39-cp39-macosx_14_0_arm64.whl (549.3 kB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

mlx-0.29.3-cp39-cp39-macosx_13_0_arm64.whl (549.3 kB view details)

Uploaded CPython 3.9macOS 13.0+ ARM64

File details

Details for the file mlx-0.29.3-cp313-cp313-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for mlx-0.29.3-cp313-cp313-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 e217a99ece66832a2e631131df32e9feb047276b68ac59ca0ad63735842f6dd0
MD5 1ae0c7df88050f54a1ce10730ff67a62
BLAKE2b-256 f290d481dd70b351e28718cfc9a0deb229a75e140abda3ed59284cf635f93f12

See more details on using hashes here.

File details

Details for the file mlx-0.29.3-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.3-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ec0aef311fab10cb5f2c274afa6edf6c482636096a5f7886aba43676454aa462
MD5 9a679df154d96ff4c1ae6d6808499d21
BLAKE2b-256 ad76196c248c2b2a471f795356564ad1d7dc40284160c8b66370ffadfd991fa1

See more details on using hashes here.

File details

Details for the file mlx-0.29.3-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.3-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 6642aa0a6dc2242c024fb8274d00631a7e7ffbdcef26148afd299b877c1e6a4a
MD5 8852735ac4316317cfc4f254b20dd6ad
BLAKE2b-256 aebb869eaac4efaae033c13db5fddd6a8907b5d667d135a35a2e482b1af402ee

See more details on using hashes here.

File details

Details for the file mlx-0.29.3-cp313-cp313-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.3-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 d59eccf6a1e1e131becc5a3910504507862da3a4e9b7bd9e73a625515d767844
MD5 156254b5004b038f80618038218ec6b5
BLAKE2b-256 fea2078152b45aa8a23949a1b09601d0044f8bb4ab85e909e4475a440c21aaea

See more details on using hashes here.

File details

Details for the file mlx-0.29.3-cp312-cp312-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for mlx-0.29.3-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 f09f71ee958f04824b7c7b275a1c1deb052740f5e69eccbff6672e43d9d7f890
MD5 42f7594e6e410c89cd15941196f1a209
BLAKE2b-256 0ec7af484ab5a4864384dc8a5f6f8ade9a29bd6e7a652e535f2ca39cf473ce26

See more details on using hashes here.

File details

Details for the file mlx-0.29.3-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.3-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 b2e1a249437d017a7425358420d28e641b7bc9c2650f3e013c1b1f4f239d8533
MD5 492d4c15138aafb727ffe2500f310711
BLAKE2b-256 1189aa424217a7a0291b84f8969d504ac63f5af0ef60f248fe5562c3d6e44048

See more details on using hashes here.

File details

Details for the file mlx-0.29.3-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.3-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 cddf6bcdc561094af6b3f0706f8768ecc5216a97eb6973e838c3ac2e2fca2cc8
MD5 4f489db2df2a04641165f9fe155e1844
BLAKE2b-256 c6e25177c80e8c33a8be89fa45fa0a839d5b6a5578687d0ec973bf03638a4e73

See more details on using hashes here.

File details

Details for the file mlx-0.29.3-cp312-cp312-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.3-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 86c62791ce930028d75c41b88b4e3ceb58f5f2e263ff9bfacda998b0c03d9544
MD5 d6bc55d988d08090851ccacd200fecb4
BLAKE2b-256 07f514e12e219a2715296150d35f930dc3a6ff319cd60126408e563f03100113

See more details on using hashes here.

File details

Details for the file mlx-0.29.3-cp311-cp311-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for mlx-0.29.3-cp311-cp311-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 8ead74126ffcc1ae49f3b1e0e988620ffbb059c38184f4e9390e294808e2c614
MD5 204cd488f6400b7f9bb19d931954ea36
BLAKE2b-256 cb179c85fc6ebe6b8ad30c3e75c0cb869939df82146aa8728de1261adacc731d

See more details on using hashes here.

File details

Details for the file mlx-0.29.3-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.3-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d33bff69887fadfd85ce67b8e11318c2319984f3ad4157f871aa9d3beb9de972
MD5 f79436dc41ef8636639246fe98617059
BLAKE2b-256 721c45642746d36e91e26f3401e9b7931f92d8cc1eb6015cc40218628f320747

See more details on using hashes here.

File details

Details for the file mlx-0.29.3-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.3-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e7d1d815be0d4a41e598bdb2992822dafd9ab0d59d4b88af760ee0b6584506b7
MD5 5134bb9e2fce77f252cad8fde2ae27d0
BLAKE2b-256 1301ce008d14fbd2e22b694f568ab4014e14c979a2262c5f8c10e06d4806709f

See more details on using hashes here.

File details

Details for the file mlx-0.29.3-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.3-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 0ffdf1f171c903adeaa688210ba39063059b102f3dcc52a64c2200d95d237f15
MD5 5f981095005be17204b574fa97012178
BLAKE2b-256 94133e91a37fa55dc0e9114620729ab61b27f45ed59053fc77846cad2df54f21

See more details on using hashes here.

File details

Details for the file mlx-0.29.3-cp310-cp310-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for mlx-0.29.3-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 ffb3a167da52baeb05756895298a2d582b5e9b9b9364b4a454b78b824a9fa482
MD5 a1f66be9edf5997fb72e72a08efda87a
BLAKE2b-256 1b53a9648dff9544a201e9ed483f1e0b18cdd92d9be453d58f1fedfd99cde6e1

See more details on using hashes here.

File details

Details for the file mlx-0.29.3-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.3-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 1bba5203ed3f785167f5b8891c2e91ede23401586b0a723bfaf815a3ed450e3d
MD5 128c6a54b31adb3614ba5e0e872bedfe
BLAKE2b-256 49850c58bdc5733ba92f78f067fc25e131e34db46562719d7909cebfad9313c5

See more details on using hashes here.

File details

Details for the file mlx-0.29.3-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.3-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 8449c0e7c221e38368a734a471e0c4b1a7fea072947c75e893a1ee214f208d34
MD5 d6e7be536dd4d08c7f629ed1376aefc6
BLAKE2b-256 b32aaf1b8391b6f543e59ca595f63aaddc33e320d3cc57a4c86ded6932d9dc3c

See more details on using hashes here.

File details

Details for the file mlx-0.29.3-cp310-cp310-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.3-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 340d46443fe0b1e5d84c1e36aa633310de70365ce79aefcaa6f618e62bd4b045
MD5 8138a2d8fe90db1d7ac63f10289303e7
BLAKE2b-256 a48a743ff24a07f8cfd6fb14b3fe05f122f1d8e04e8a912b2f6d0e14369c8caf

See more details on using hashes here.

File details

Details for the file mlx-0.29.3-cp39-cp39-manylinux_2_35_x86_64.whl.

File metadata

  • Download URL: mlx-0.29.3-cp39-cp39-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 653.2 kB
  • Tags: CPython 3.9, manylinux: glibc 2.35+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.24

File hashes

Hashes for mlx-0.29.3-cp39-cp39-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 efefa29663387f9340602d4b5906881398eda12f48882a60994fd2b379848d96
MD5 681168e2524c2e598e6678e744fc6c0b
BLAKE2b-256 ab3b050b8cbe6e326a8ad982ef7690913cf8da6303e439029ce45a6de0476743

See more details on using hashes here.

File details

Details for the file mlx-0.29.3-cp39-cp39-macosx_15_0_arm64.whl.

File metadata

  • Download URL: mlx-0.29.3-cp39-cp39-macosx_15_0_arm64.whl
  • Upload date:
  • Size: 549.3 kB
  • Tags: CPython 3.9, macOS 15.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.24

File hashes

Hashes for mlx-0.29.3-cp39-cp39-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ac2409a1ba79149143232a02ae5b1a201864413979a76d8f9d63107022e0dce5
MD5 c92a149085b95cf7b41fa952058fed32
BLAKE2b-256 7995af0ebe08bc917b3ef2bd91e7c149c31000ce72deffbf55cd8d96e43ea208

See more details on using hashes here.

File details

Details for the file mlx-0.29.3-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

  • Download URL: mlx-0.29.3-cp39-cp39-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 549.3 kB
  • Tags: CPython 3.9, macOS 14.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.24

File hashes

Hashes for mlx-0.29.3-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 30a1da8b2aeb4f4b405759b108abbbe3b4f8c5924ac3d550006509bc7bcbfc49
MD5 318664326dc98e6b2261027e5ad6bcbf
BLAKE2b-256 593093cab1b5e59b879a5a4346684d7564a7e5d74e6f9448163c6b118f167cad

See more details on using hashes here.

File details

Details for the file mlx-0.29.3-cp39-cp39-macosx_13_0_arm64.whl.

File metadata

  • Download URL: mlx-0.29.3-cp39-cp39-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 549.3 kB
  • Tags: CPython 3.9, macOS 13.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.24

File hashes

Hashes for mlx-0.29.3-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 c6778d023cc540a83a08caa750c9752523c24ddebd4201b2f34c9e0a2e109394
MD5 b63851eed2456d13583627966ffc347a
BLAKE2b-256 cfeb3ad14e1acb45bcccb3031247cb9fb3ad18d73fa647fed59fe238de99a68e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page